<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>所有浮动元素后面设置添加一个块级元素,并给该元素设置clear:both</title>
    <style>
        .outer {
            width: 500px;
            background-color: gray;
            border: 1px solid black;

        }

        .box {
            width: 100px;
            height: 100px;
            background-color: skyblue;
            border: 1px solid black;
            margin: 10px;
        }

        .box1, .box2, .box3 {
            float: left;
        }

        /*.box4 {*/
        /*    clear: both;*/
        /*}*/

        .mofa {
            clear: both;
        }
    </style>
</head>
<body>
<div class="outer">
    <div class="box box1">1</div>
    <div class="box box2">2</div>
    <div class="box box3">3</div>
    <div class="mofa"></div>
    <div class="box box4">4</div>
</div>
<div style="background-color: orange">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit, voluptas.
</div>
</body>
</html>